/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jmodcog2.fwd;

import jmodcog2.fwd.config.NetConfig;

/**
 *
 * @author Mitch
 */
public abstract class TrainedNet extends BiasNet {
    
    @Constant
    protected final float[] conn_weights;
    @Constant
    protected final float[] conn_biases;
    
    protected TrainedNet(NetConfig config) {
        super(config);
        this.conn_weights = config.createConns();
        this.conn_biases = config.createBiasConns();
    }
    
    
    @Override
    protected float _get_conn_weight(int index) {
        return conn_weights[index];
    }
    
    @Override
    protected void _set_conn_weight(int index, float val) {
        conn_weights[index] = val;
    }
    
    @Override
    protected float _get_bias(int index) {
        return conn_biases[index];
    }
    
    @Override
    protected void _set_bias(int index, float val) {
        conn_biases[index] = val;
    }
    
    
    @Override
    protected void _add_conn_weight(int index, float val) {
        conn_weights[index] += val;
    }
    
    @Override
    protected void _add_bias(int index, float val) {
        conn_biases[index] += val;
    }
}
